package com.object;

import java.util.ArrayList;

public class OperateLog extends LoginLog{
    private String  type;
    public OperateLog(){}
    public OperateLog(String uid, String name, String loginTime, String type) {
        super(uid, name, loginTime);
        this.type = type;
    }

    public OperateLog(String type) {
        this.type = type;
    }

    public String getType() {
        return type;
    }
    public void setType(String type) {
        this.type = type;
    }
    public ArrayList<OperateLog> addLog(ArrayList<OperateLog>operateLogs,User user,String type){
        OperateLog log = new OperateLog(user.getUid(),user.getName(), user.getTime(),type);
        operateLogs.add(log);
        return  operateLogs;
    }
    public ArrayList<OperateLog>    viewOperate(ArrayList<OperateLog>operateLogs){
        System.out.println("用户id    用户名    操作项目    操作时间");
        for (OperateLog operateLog : operateLogs) {
            System.out.println(operateLog.getUid()+"      "+operateLog.getName()+"       "+operateLog.getType()+"  "+operateLog.getLoginTime());
        }
        return operateLogs;
    }

}
